package com.xwaiy.xwaiyrpc.loadbalancer;

import com.xwaiy.xwaiyrpc.spi.SpiLoader;

/**
 * 负载均衡器工厂
 * @Author Xwaiy
 * @Date 2025/9/3 13:56
 **/
public class LoadBalancerFactory {

    static {
        SpiLoader.load(LoadBalancer.class);
    }

    // 默认
    private static final LoadBalancer DEFAULT_LOAD_BALANCER = new RoundRobinLoadBalancer();

    // 实例
    public static LoadBalancer getInstance(String key) {
        return SpiLoader.getInstance(LoadBalancer.class,key);
    }
}
